<?php
/*
 * @Author: 李明
 * @Date: 2021-08-24 11:59:43
 * @LastEditTime: 2022-01-13 16:46:12
 * @LastEditors: 李明
 * @Description: 
 * @FilePath: /CRM2.0-PHP/app/Models/Tag.php
 * @山东壹零贰肆信息科技有限公司
 */

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class Tag
 * 
 * @property int $id
 * @property string $name
 * @property Carbon|null $create_time
 * @property Carbon|null $update_time
 * 
 * @property Collection|User[] $users
 *
 * @package App\Models
 */
class Tag extends Model
{
    protected $table = 'tag';

    protected $fillable = [
        'name'
    ];

    public function users()
    {
        return $this->belongsToMany(User::class, 'user_tag')
            ->withPivot('id')
            ->withTimestamps();
    }
}
